<template>
  <div class="ent_pro" id="myChart" style="width: 658px; margin: auto">
    <img src="@/assets/images/portrait.png" alt="" />
    <span class="pro_num esData">{{ GetYear(data.incorporationDate) }}</span>
    <span class="pro_num regCap">{{
      data.registeredCapital ? `${data.registeredCapital} 万元` : ""
    }}</span>
    <span class="pro_num entChangeCnt">{{ data.changeLogCnt }}次</span>
    <span class="pro_num productTag1">{{ data.mainProductCnt }}个</span>
    <span class="pro_num productTag2">{{ data.selfNewProductCnt }}个</span>
    <span class="pro_num productTag3">{{ data.patentNewProductCnt }}个</span>
    <span class="pro_num productTag4">{{ data.otherProductCnt }}个</span>
    <span class="pro_num materialsCnt">{{ data.materialDemandCnt }}</span>
    <span class="pro_num productInfoCnt">{{
      data.productSupplyCnt ? data.productSupplyCnt : "0"
    }}</span>
    <span class="pro_num productSaleCnt">{{
      data.needConnectionCnt ? data.needConnectionCnt : "0"
    }}</span>
    <span class="pro_num biddingCnt">{{
      data.purchaseCnt ? data.purchaseCnt : "0"
    }}</span>
    <span class="pro_num merchantsCnt">{{
      data.investmentCnt ? data.investmentCnt : "0"
    }}</span>
    <span class="pro_num entHonorCnt">{{
      data.certificateCnt ? data.certificateCnt : "0"
    }}</span>
    <span class="pro_num entCertCnt">{{
      data.qualificationCnt ? data.qualificationCnt : "0"
    }}</span>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  props: {
    data: {
      type: Object,
      default: () => {},
    },
  },
  methods: {
    GetYear(val) {
      let _date = new Date(val);
      let _nowdate = new Date();
      let _years = _date.getFullYear();
      let _nowyears = _nowdate.getFullYear();

      if (_nowyears - _years == 0) {
        return "1年以下";
      } else {
        return _nowyears - _years + "年";
      }
    },
  },
};
</script>

<style lang="less" scoped>
.ent_pro {
  position: relative;
  height: 375px;
  width: 100%;
  text-align: center;

  .pro_num {
    position: absolute;
    font-family: Microsoft YaHei;
    font-size: 14px;
  }

  .esData {
    left: 310px;
    top: 0px;
    color: #0da9b0;
  }

  .regCap {
    left: 425px;
    top: 7px;
    color: #0da9b0;
  }

  .entChangeCnt {
    left: 465px;
    top: 56px;
    color: #0da9b0;
  }

  .productTag1 {
    left: 572px;
    top: 103px;
    color: #188af1;
  }

  .productTag2 {
    left: 615px;
    top: 138px;
    color: #188af1;
  }

  .productTag3 {
    left: 600px;
    top: 176px;
    color: #188af1;
  }

  .productTag4 {
    left: 536px;
    top: 207px;
    color: #188af1;
  }

  .materialsCnt {
    left: 532px;
    top: 262px;
    color: #ee6224;
  }

  .productInfoCnt {
    left: 546px;
    top: 314px;
    color: #ee6224;
  }

  .productSaleCnt {
    left: 486px;
    top: 349px;
    color: #ee6224;
  }

  .biddingCnt {
    left: 129px;
    top: 252px;
    color: #188af1;
  }

  .merchantsCnt {
    left: 128px;
    top: 202px;
    color: #188af1;
  }

  .entHonorCnt {
    left: 132px;
    top: 130px;
    color: #ff9f00;
  }

  .entCertCnt {
    left: 128px;
    top: 89px;
    color: #ff9f00;
  }

  img {
    // width:560px;
    height: 368px;
    object-fit: cover;
  }
}
</style>
